package com.linkin.homepage.util;


import android.os.Handler;
import android.os.Looper;


public class HandlerUtils {

    private static Handler sHandler = new Handler(Looper.getMainLooper());

    public static Handler getMainHandler() {
        return sHandler;
    }


    public static void runOnUIThread(Runnable runnable) {
        if (runnable != null) {
            if (Thread.currentThread() != Looper.getMainLooper().getThread()) {
                getMainHandler().post(runnable);
            } else {
                runnable.run();
            }
        }
    }
}
